Fixes 649 to add support for HOUR, MINUTE, SECOND date literals and s…#756
Merged
wumpz merged 1 commit intoJSQLParser:masterfrom Feb 25, 2019
Merged
Fixes 649 to add support for HOUR, MINUTE, SECOND date literals and s…#756wumpz merged 1 commit intoJSQLParser:masterfrom
wumpz merged 1 commit intoJSQLParser:masterfrom
Conversation
…upport for identifiers as the interval parameter.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…upport for identifiers as the interval parameter.
See my comments in issue #649.
If you add <S_IDENTIFIER> to the line ( token=<S_LONG> | token=<S_DOUBLE> | token=<S_CHAR_LITERAL> | token = <S_IDENTIFIER>) it fixes many of the issues we are seeing (most of the time we use a single identifier as the offset value; it is a less frequent case that we use an expression).
A test case for this scenario is:
select current_date + foo day as next_day from fooIt still does not work for expressions. I tried adding support for an expression directly there, but it gives a left parse error when reading the .jj file. I tried wrapping the expression in brackets (accepted but not required in DB2), and everything compiled but tests started to fail - it looks like the parser was getting confused.
Anyway, the S_IDENTIFIER change works for most of our reports. There are now only 11 out of 1553 reports which fail to parse.